/**
 * @version 1.0
 * @author Ha Giang
 * @date 
 */
package Demo;

import Configuration.Utils;
import DiscoveryFunction.Service;
import DiscoveryFunction.ServiceInfo;

/**
 * Create 2 services, register them
 * 
 */
public class DemoService {
     public static void main(String[] args) {

        ServiceInfo si = new ServiceInfo();
        si.setUuid("UUID");
        si.setIp("127.0.0.1");
        si.setType("EchoService");
        si.setPort(Utils.UNICAST_ECHO_SERVICE_PORT);
        si.setExpire(10000);
        Service echoService = new Service(si);
        echoService.registerService();
        echoService.acceptClient();
        ///
        try{
        //Thread.sleep(1000);
        }
        catch (Exception e) {};
        
        ServiceInfo si2 = new ServiceInfo();
        si2.setUuid("UUID2");
        si2.setIp("127.0.0.1");
        si2.setType("EchoService2");
        si2.setPort(Utils.UNICAST_ECHO_SERVICE_PORT_2);
        si2.setExpire(10000);
        Service echoService2 = new Service(si2);
        echoService2.registerService();
        echoService2.acceptClient();
    }
}
